// Project name:JavaRedis
// Creator:muhong
// Date time:2023/2/7,5:22 下午
// Name:FastThreadLocalThread

package org.gmh.util.concurrent;

import org.gmh.util.internal.InternalThreadLocalMap;

public class FastThreadLocalThread extends Thread {

    private final boolean cleanupFastThreadLocals;

    private InternalThreadLocalMap threadLocalMap;

    public FastThreadLocalThread(){
        cleanupFastThreadLocals = false;
    }

    public FastThreadLocalThread(Runnable target){
        super(FastThreadLocalRunnable.wrap(target));
        cleanupFastThreadLocals = true;
    }

    public FastThreadLocalThread(String name){
        super(name);
        cleanupFastThreadLocals = true;
    }

    public FastThreadLocalThread(ThreadGroup group, Runnable target){
        super(group, FastThreadLocalRunnable.wrap(target));
        cleanupFastThreadLocals = true;
    }

    public FastThreadLocalThread(ThreadGroup group, Runnable target, String name){
        super(group, FastThreadLocalRunnable.wrap(target), name);
        cleanupFastThreadLocals = true;
    }

    public final InternalThreadLocalMap threadLocalMap(){
        return threadLocalMap;
    }

    public final void setThreadLocalMap(InternalThreadLocalMap threadLocalMap){
        this.threadLocalMap = threadLocalMap;
    }
}
